Passed
Push — master ( 9e8d48...ad4ce1 )
by Daniel
01:34 queued 10s
created

classShowHideElements.showLoadingSpinner   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
1
/**
2
 * Class that contains methods for hiding and showing elements when needed
3
 */
4
export default class classShowHideElements {
5
  /**
6
   * Show the loading spinner
7
   * @returns void
8
   */
9
  static showLoadingSpinner() {
10
    window.document.getElementById('loadingSpinner')!.classList.remove('hide');
11
  }
12
13
  /**
14
   * Hide the loading spinner
15
   * @returns void
16
   */
17
  static hideLoadingSpinner() {
18
    window.document.getElementById('loadingSpinner')!.classList.add('hide');
19
  }
20
21
  /**
22
   * Display the table and add animation class
23
   * @returns void
24
   */
25
  static showDataTable() {
26
    window.document
27
      .getElementById('tableElement')!
28
      .classList.remove('scale-out');
29
  }
30
31
  /**
32
   * Hide the table. Usually caused by an error
33
   * @returns void
34
   */
35
  static hideDataTable() {
36
    window.document.getElementById('tableElement')!.classList.add('scale-out');
37
  }
38
39
  /**
40
   * Hide loading spinner and data table
41
   * @returns void
42
   */
43
  static hideElements() {
44
    window.document.getElementById('tableElement')!.classList.add('scale-out');
45
    window.document.getElementById('loadingSpinner')!.classList.add('hide');
46
  }
47
}
48